package com.zhkj.txg.module.home.vm

import android.app.Application
import androidx.lifecycle.MutableLiveData
import com.zhkj.lib.base.BaseViewModel
import com.zhkj.lib.http.HttpResponse
import com.zhkj.lib.http.ViewModelSubscribeListener
import com.zhkj.txg.module.home.entity.GuideDetailResponse
import com.zhkj.txg.module.home.entity.WelfareResponse
import com.zhkj.txg.module.home.model.HomeManager

class WelfareViewModel(application: Application) : BaseViewModel(application) {
    private val manager = HomeManager()

    val welfareLiveData = MutableLiveData<HttpResponse<WelfareResponse>>()
    val guideDetailLiveData = MutableLiveData<HttpResponse<GuideDetailResponse>>()

    fun welfare() {
        val listener = ViewModelSubscribeListener(welfareLiveData)
        val welfare = manager.welfare(listener)
        dispose.add(welfare)
    }

    fun GuideDetail(id: Long) {
        val listener = ViewModelSubscribeListener(guideDetailLiveData)
        val guideDetail = manager.guideDetail(id, listener)
        dispose.add(dispose)
    }
}